import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '../components/Login'
import Home from '../components/homepage/Home'

import Tags from "../components/homepage/Tags";
import Header from '../components/homepage/Header';
import ZhouHomePage from '../components/HomePage';



//解决Vue前端的Session问题
import axios from 'axios'
axios.defaults.withCredentials =  true;
// 添加一个响应拦截器，将  res.data -> data
axios.interceptors.response.use(function (response) {
  return response;
}, function (error) {
  return Promise.reject(error);
});


Vue.use(Router)
export default new Router({
  routes: [
        {
        path: '/',
        redirect: '/homepage'
      },
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },{
    //登录
      path:'/login',
      name:'Login',
      component:Login
    },
    //首页
    {
      path: '/hometpage',
      name: 'Home',
      component: Home,
      meta: {
        requireAuth: true
      }
    }],
      mode:"history"//去掉#

})
